import os
import pytest
from utils.email_util import Email_Utils
from utils.log_util import setup_logger
from config.constants import *

if __name__ == '__main__':
    # 确保目录存在
    os.makedirs('./reports/json', exist_ok=True)
    # os.makedirs('./zipfile', exist_ok=True)

    # 日志
    # logg, log_file = setup_logger()

    # 执行测试 business or single
    pytest.main(['-vs', '--alluredir', './reports/json', '-m', 'single'])
    # 生成Allure报告
    # os.system('allure generate ./reports/json -o ./report/result --clean')


    # print(f'******************************{logg}******************{log_file}**************************')

    # 可选：发送邮件
    # email_utils = Email_Utils()
    # email_utils.send_email(log_file)